# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: Gaetan Bisson <bisson@archlinux.org>
# Contributor: Angel Velasquez <angvp@archlinux.org> 
# Contributor: Andrea Scarpino <andrea@archlinux.org>
# Contributor: damir <damir@archlinux.org>
# Contributor: Daniel Bainton <dpb [at] backarrow.org>

pkgname=ncmpc
pkgver=0.45
pkgrel=1
pkgdesc="Fully featured MPD client which runs in a terminal"
url='https://www.musicpd.org/clients/ncmpc/'
arch=('x86_64')
license=('GPL2')
depends=('gcc-libs' 'glibc' 'lirc' 'pcre')
makedepends=('boost' 'libmpdclient' 'meson' 'ncurses' 'python-sphinx')
optdepends=('python-requests: for lyrics script')
source=("https://www.musicpd.org/download/${pkgname}/${pkgver%.*}/${pkgname}-${pkgver}.tar.xz"{,.sig})
sha512sums=('9e8c6c61547458e0fe20ccd31d4733949352688c00b66e38930b475434dbd69789f701df0de01cd1574c6250ad2f43f1258cb095d4b47af7a58b6840a8c70ccd'
            'SKIP')
b2sums=('f8d8744bf1a43bcc909b390d3dee555cbe8c875a8d77d0fbb8bccfbc7bb28c678d337d8db7a2a038f501e8dd16e93dc6cb6d1c5eae1c87f676750d793718f0af'
        'SKIP')
validpgpkeys=('0392335A78083894A4301C43236E8A58C6DB4512') # Max Kellermann <max@blarg.de>

build() {
  cd "${pkgname}-${pkgver}"
  meson --prefix /usr \
        --libexecdir lib \
        --sbindir bin \
        --buildtype plain \
        --auto-features enabled \
        --wrap-mode nodownload \
        -D b_lto=true \
        -D b_pie=true \
        -D lyrics_screen=true \
        -D chat_screen=true \
        build
  ninja -C build
}

package() {
  depends+=('libmpdclient.so' 'libncursesw.so')
  cd "${pkgname}-${pkgver}"
  DESTDIR="${pkgdir}" ninja -C build install
}
